<br/>
<?php if(!empty($details))
{
 ?>
     <section id="top_details" class="wrapper clearfix">
    	<div class="left_details">
            <?php $image = explode(',',$details->avartar); ?>
    		<img width="135" height="180" src="<?php echo get_thumnails($image[0],139,207); ?>" class="big_images" alt="<?php echo $details->name; ?>" />
    	</div>
    	<!-- /.left_details -->
    	<div class="center-details">
    		<h2 class="title_deyails"><?php echo $details->name; ?></h2>
    		<p class="sub_details"><?php echo $details->profile_tit; ?></p>
            <p><?php  echo $this->common_model->getnumber2('rating_star',array('tutorid'=>$details->id));?> Đánh giá</p>
    		<ul class="center2">
    			<li class="rating_details"><i class="icon-star"></i><i class="icon-star"></i><i class="icon-star"></i><i class="icon-star"></i><i class="icon-star"></i></li>
    			<li class="background"><a href="javascript://" title=""><i class="icon-check"></i> Đã vượt qua bài test</a></li>
    			<!-- /.background -->
    			<li class="center3"><i class="icon-email"></i><a href="javascript://">Gia sư sẽ trả lời email trong: <i style="color: red;"> <?php if(!empty($details->repmail)){ echo $details->repmail.'h'; }else{echo 'Chưa cập nhật';} ?></i></a></li>
                <li class="sosical">
                    <div class="fb-like" data-layout="button_count" data-action="like" data-show-faces="true" data-share="true"></div>
    			    <g:plusone></g:plusone>
                </li>
                <li class="center3">
                    <div class="thumnails">
                        <?php if(!empty($image)) { foreach ($image as $thumb){ echo '<img class="img_thumb" src="'.get_thumnails($thumb,139,207).'" width="35" height="35" alt="'.$details->name.'" />';}} ?>
                    </div>
                </li>
    		</ul>
    	</div>
    	<!-- /.center-details -->
    	<div class="right_details">
            <?php if(!empty($city)) { ?>
    		<a href="<?php echo base_url().'dia-diem/'.$city->id; ?>" class="localtion_details">
            <?php if(!empty($city->title)) { echo $city->title; } ?>,<?php if(!empty($huyen->title)) { echo $huyen->title; } ?></a><?php } ?>
    		<p>Học phí : <span style="color: red;font-weight:bold;"><?php if($details->mucluong != 0) { echo number_format($details->mucluong).'</span> VNĐ /Buổi';} else{ echo 'Chưa cập nhật';} ?></p>
    		<p><?php //echo $details->details_luong; ?></p>
            <p>Bạn có thể học thử cho đến khi tìm được gia sư như ý</p>
            <a href="javascript://" data-action='email' class="click_details btn_details">Học gia sư này</a>
    	</div>
    	<!-- /.right_details -->
    </section>
    <!-- /#top_details -->
    <div class="des_tabs wrapper clearfix">
    <ul class="tabs_navi">
    	<li><a href="javascript://" data-action='info' class="click_details active_tabs">Thông tin chung</a></li>
    	<li><a href="javascript://" class="click_details" data-action='feedback'>Phản hồi từ học sinh</a></li>
    	<li><a href="javascript://" class="click_details" data-action='lession'>Thông tin về môn dạy</a></li>
    	<li><a href="javascript://" class="click_details" data-action='email'>Email</a></li>
    </ul>
    <!-- /.tabs_navi -->
    <div class="clearfix">&nbsp;</div>
    <section class="main_tabs">
            <div class="left_mail">
                <div class="col_de1">
                    <?php echo $details->description1; ?>
                </div>
				<br/>
                <div class="col_de1">
                    <?php echo $details->description2; ?>
                </div>
                    <div class="col_de4">
        <?php if(!empty($cha))
        { ?>
        <ul id="main_mon">
        <?php  foreach($cha as $a) { ?>
            <li class="parent_sub"><span class="parent"><?php echo $a->title; ?></span>
                <ul>
                <?php if($mang) { foreach ($mang[$a->id] as $b) {  ?>
                
                <li><span><?php echo $b->title; ?></span></li>
                <?php } } ?>
                </ul>
            </li>
        <?php } ?>
        </ul>
        <?php } ?>
    </div>
    <div class="col_de4">
                <?php if(!empty($huongdan)) { ?>
                <?php foreach ($huongdan as $hd):
                    if(!empty($hd->subid)) { $ten_monhoc = $this->common_model->getone('subjects',array('id'=>$hd->subid)); }
                 ?>
                    <?php if(!empty($ten_monhoc)) {
                        if(!empty($hd->description)){  
                    ?>
                            <div class="sub1">
                                <h2 class="sj_title"><?php echo $ten_monhoc->title; ?></h2>
                                <div class="des_sub">
                                    <?php echo $hd->description; ?>
                                </div>
                            </div>
                <?php  }  } endforeach; }?>
    </div>
            </div>
            <!-- /.left_mail -->
            <div class="right_mail">
                <div class="col_de3 education">
                    <h4 class="title_de2 bg_education">Trình độ học vấn/ Nghề Nghiệp</h4>
                    <?php if(!empty($education->cap3)) { ?><p class="node1">THPT: <span class="cap3"><?php echo $education->cap3; ?></span><?php if(!empty($education->truongchuyen)) { echo ' ( <span class="chuyen">Lớp chuyên :'.$education->truongchuyen.'</span> )';} ?></p> <?php } ?>
                    <?php if(!empty($education->bang1)) { ?><p class="node1">ĐH / CĐ: <span class="cap3"><?php echo $education->bang1; ?></span><?php if(!empty($education->chuyennganh)) { echo ' ( <span class="chuyen">Chuyên nghành :'.$education->chuyennganh.'</span> )';} ?></p> <?php } ?>
                    <?php if(!empty($details->jobs)) { ?><p class="node1">Nghề nghiệp: <span class="cap3"><?php if($details->jobs != '') { echo $details->jobs; }else{echo 'Nghề Khác';} ?></span></span></p> <?php } ?>
                </div>
                <div class="col_de3 price">
                    <h4 class="title_de2 title_price"><i class="icon-usd bluclass"></i>&nbsp;&nbsp;Học phí</h4>
                    <div class="node1"><p class="cap3"><span class="price"><?php if($details->mucluong != 0) { echo number_format($details->mucluong).' VNĐ /Buổi';} else{ echo 'Chưa cập nhật';} ?></span></p>
                    <p><?php echo $details->details_luong; ?></p>
                    </div>
                </div>
                <?php if($details->daynhieu != 0)
                    {
                        
                ?>
                <div class="col_de3 price">
                    <h4 class="title_de2 title_price"><i class="icon-usd bluclass"></i>&nbsp;&nbsp;Học phí dạy <?php echo $details->daynhieu.' học sinh'; ?></h4>
                    <p class="node1"><p class="cap3"><span class="price"><?php echo number_format($details->tiendaynhieu); ?> VNĐ / Buổi</span></p>
                </div>
                <?php } ?>
                <?php if(!empty($videos)){ parse_str(parse_url($videos->link, PHP_URL_QUERY), $youtube);
                        $link2 = $youtube['v']; ?>
                    <div class="popup_video hidden">
                        <object width="1" height="1"><param name="movie" value="http://www.youtube.com/v/<?php echo $link2; ?>&hl=en&autoplay=1&color1=0x234900&color2=0x4e9e00" />
                            <param name="allowFullScreen" value="true" />
                            <param name="allowscriptaccess" value="always" />
                            <embed src="http://www.youtube.com/v/<?php echo $link2; ?>&hl=en&autoplay=1&color1=0x234900&color2=0x4e9e00" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="640" height="380" />
                        </object>
                        <p class="close">
                            <i class="icon-remove icon-2x"></i>
                        </p>
                    </div>
                    <div class="col_de3 clearfix">
                        <div class="thumbvideos clearfix">
                            <img width="95" height="95" src="http://img.youtube.com/vi/<?php echo $link2; ?>/1.jpg" style="float: left;" alt="Video Giới thiệu của gia sư <?php echo $details->name; ?>" />
                            <div class="playvideo">
                                <i class="icon-play icon-3x"></i><span>Xem Video</span>
                            </div>
                        </div>
                    </div>
                <?php } ?>
                <div class="col_de3">
                    <img src="<?php echo base_url().'skin/front-end/images/goodFit60.png' ?>" style="float: left;" alt="Được đảm bảo bởi 10+" />
                    <p class="node_fit">Chất lượng của gia sư được bảo vệ bởi chính 10+ . Bạn sẽ không phải mất bất kì một khoản học phí nào cho đến khi tìm được gia sư phù hợp nhất</p>
                </div>
            	<div class="col_de2">
                    <?php $this->load->view('com_tutors/views_form_email.php'); ?>
                </div>
            </div>
            <!-- /.right_mail -->
                </section>
                <?php 
                    $alias = preg_replace("/(.html)/",'', $this->security->xss_clean($this->uri->segment(1,0)));
                    $idusser = substr($alias,17);
                ?>
    <script>
    	$(document).ready(function() {
    		$('.click_details').click(function() {
    			/* Act on the event */
                $('.tabs_navi li a').removeClass('active_tabs');
    	        $(this).addClass('active_tabs');
                var action = $(this).attr('data-action');
                var url = window.location.href;
                $('.main_tabs'). prepend('<div><i class="icon-spinner icon-spin icon-large"></i> Đang tải dữ liệu vui lòng đợi...</div>')
                 $.ajax({
                          type: "POST",
                          url: '<?php echo base_url(); ?>ajax/thong-tin-gia-su<?php echo '.',$idusser;?>',
                          data: {
                            action : action,
                            url : url
                            },
                          success: success
                        });
    		});
            function success(data,status){
                $('.main_tabs').html(data);
				$('body, html').animate({
					scrollTop: $('.main_tabs').offset().top - 100
				}, 800);
               };
    	});
    </script>
    <script>
    $(document).ready(function()
    {
            $('.img_thumb').click(function(){
               var linkimg = $(this).attr('src');
               $('.big_images').attr('src',linkimg);
            }); 
    });
    </script>
 <?php } else { ?>
 <section  class="wrapper min720">
    <h2><?php echo $thongbao; ?></h2>
 </section>
 <?php } ?>
 <script>
    $(document).ready(function(){
       $('.thumbvideos').click(function(){
            $('.popup_video').fadeIn();
            $('.overlay').fadeIn();
       }); 
       $('.close').click(function(){
            $('.popup_video').fadeOut();
             $('.overlay').fadeOut();
       });
    });
 </script>
<style>
#main_mon
{
    width:100%;
}
#main_mon li
{
    list-style:none;
}
#main_mon li.parent_sub span.parent
{
    color:#ff9900;
    font-weight:bold;
    text-transform: capitalize;
    border-bottom:1px dashed #ccc;
    padding-bottom:10px;
    display:block;
}
#main_mon li.parent_sub ul li
{
    margin-left:15px;
}
#main_mon li.parent_sub ul li span
{
    color:#333;
    font-weight:normal;
}
</style>